package com.bdqn.Practice.service;

import com.bdqn.Practice.mapper.SysUserMapper;
import com.bdqn.Practice.pojo.SysRole;
import com.bdqn.Practice.pojo.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService{
    @Autowired
    private SysUserMapper sysUserMapper;
    @Override
    public List<SysUser> list() {
        return sysUserMapper.list();
    }
    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int add(SysRole sysRole) {
        return sysUserMapper.add(sysRole);
    }
    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int delete(int id) {
        return sysUserMapper.delete(id);
    }
    @Transactional(propagation = Propagation.REQUIRED)
    @Override
    public int update(SysRole sysRole) {
        return sysUserMapper.update(sysRole);
    }

    public SysUserMapper getSysUserMapper() {
        return sysUserMapper;
    }

    public void setSysUserMapper(SysUserMapper sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }

}
